<?xml version="1.0" encoding="${encoding}"?>
<beans xmlns="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop"
 xmlns:context="http://www.springframework.org/schema/context" xmlns:tx="http://www.springframework.org/schema/tx"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
 	http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
    http://www.springframework.org/schema/tx 
    http://www.springframework.org/schema/tx/spring-tx-2.5.xsd
    http://www.springframework.org/schema/aop 
    http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-2.5.xsd"
    default-autowire="byName" >

	<context:property-placeholder location="classpath:${confDS}"/>
	
	<bean id="mysqlDS" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
		<#noparse>
		<property name="driverClassName" value="${mysql.jdbc.driverClassName}"/>
		<property name="url" value="${mysql.jdbc.url}"/>
		<property name="username" value="${mysql.jdbc.username}"/>
		<property name="password" value="${mysql.jdbc.password}"/>
		<property name="initialSize" value="${mysql.jdbc.initialSize}" />
		<property name="minIdle" value="${mysql.jdbc.minIdle}" />
		<property name="maxIdle" value="${mysql.jdbc.maxIdle}" />
		<property name="maxActive" value="${mysql.jdbc.maxActive}" />
		<property name="logAbandoned" value="${mysql.jdbc.logAbandoned}" />
		<property name="removeAbandoned" value="${mysql.jdbc.removeAbandoned}" />
		<property name="removeAbandonedTimeout" value="${mysql.jdbc.removeAbandonedTimeout}" />
		<property name="maxWait" value="${mysql.jdbc.maxWait}" />
		<property name="validationQuery" value="${mysql.jdbc.validationQuery}" />
		</#noparse>
	</bean>
	
	<bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
		<property name="dataSource" ref="mysqlDS"></property>
	</bean>
	
	<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
		<property name="dataSource" ref="mysqlDS" />
	    <property name="configLocation" value="classpath:${confMybatis}"/>
	    <property name="mapperLocations" value="classpath:${mapperPath?replace("\\","/")}"></property>
	</bean>

</beans>